﻿Ext.define('yzmh.view.collect.ChapterImport', {
    extend: 'Ext.window.Window',
    alias: 'widget.chapterimport',

    title: '导入章节',
    icon: 'extjs/icons/book_add.png',
    layout: 'fit',
    autoShow: true,
    width: 600,

    initComponent: function () {

        this.items = [
            {
                xtype: 'form',
                border: true,
                frame: true,
                bodyPadding: '5 5 0',
                fieldDefaults: {
                    labelAlign: 'right',
                    labelWidth: 60,
                    anchor: '100%'
                },
                items: [Ext.create('Ext.ux.form.field.BoxSelect', {
                    fieldLabel: "漫画名称",
                    store: "Comics",
                    pageSize: 25,
                    typeAhead: true,
                    queryMode: "local",
                    minChars: 1,
                    delimiter: ",",
                    forceSelection: false,
                    filterPickList: false,
                    multiSelect: false,
                    //triggerOnClick: false,
                    labelTpl: "{mhmc}",
                    listConfig: {
                        tpl: [
                           "<ul><tpl for=\".\">",
                           "<li role=\"option\" class=\"x-boundlist-item\">{mhmc}[{zzmc}]</li>",
                           "</tpl></ul>"
                        ]
                    },
                    name: "id",
                    displayField: "mhmc",
                    valueField: "id",
                    emptyText: "请输入漫画名称",
                    allowBlank: false
                }), {
                    xtype:'combo',
                    fieldLabel: "更新章节",
                    store: "Chapters",
                    typeAhead: true,
                    queryMode: "local",
                    forceSelection: true,
                    editable:false,
                    labelTpl: "{zjmc}",
                    listConfig: {
                        tpl: [
                           "<ul><tpl for=\".\">",
                           "<li role=\"option\" class=\"x-boundlist-item\">{zjmc}[{tpadd}]</li>",
                           "</tpl></ul>"
                        ]
                    },
                    name: "zjid",
                    displayField: "zjmc",
                    valueField: "id"
                }, {
                    xtype: 'textareafield',
                    name: 'zjurl',
                    fieldLabel: '章节地址',
                    height:300
                }, {
                    xtype: 'textfield',
                    name: 'tpadd',
                    fieldLabel: '存放地址'
                }, {
                    xtype: 'hidden',
                    name: 'action'
                }]
            }
        ];

        this.buttons = [
            {
                text: '保存',
                action: 'save'
            },
            {
                text: '取消',
                scope: this,
                handler: this.close
            }
        ];

        this.callParent(arguments);
    }
});